package com.macro.mall.portal.controller;

import com.macro.mall.common.api.CommonResult;
import com.macro.mall.model.CmsFeedback;
import com.macro.mall.model.CmsFeedbackCategory;
import com.macro.mall.portal.domain.AddPmsProductComment;
import com.macro.mall.portal.domain.PmsProductCommentRes;
import com.macro.mall.portal.service.CommentService;
import com.macro.mall.portal.service.FeedBackService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 反馈
 */
@Controller
@Api(tags = "反馈")
@Tag(name = "PmsFeedBackController", description = "反馈")
@RequestMapping("/feedBack")
public class PmsFeedBackController {
    @Autowired
    private FeedBackService feedBackService;

    @ApiOperation("查询反馈类型列表")
    @RequestMapping(value = "/selFeedBackList", method = RequestMethod.GET)
    @ResponseBody
    public CommonResult<List<CmsFeedbackCategory>> selFeedBackList() {
        List<CmsFeedbackCategory> cmsFeedbackCategories = feedBackService.selFeedBackList();
        return CommonResult.success(cmsFeedbackCategories);
    }


    @ApiOperation("提交反馈")
    @RequestMapping(value = "/addFeedBackList", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult<Void> addFeedBackList(@RequestBody CmsFeedback cmsFeedback) {
        feedBackService.addFeedBackList(cmsFeedback);
        return CommonResult.success(null);
    }


}
